/* RMORPG - Logger.h
   Copyright (C) 2006  Michael Borgmann <code@lechuck.de>
   This code is released under the GNU Public License (GPL)
*/

#ifndef _LOGGER_H
#define _LOGGER_H

#include <fstream>

namespace rmorpg {

	/**
	 * Log System
	 */
	class Logger {
		private:
			std::fstream logfile;

			/**
			 * Title of log
			 *
			 * @param title title of log
			 */
			std::string Title(const std::string &title);

			/**
			 * Time Stamp
			 *
			 * @return time stamp
			 */
			std::string TimeStamp();

		public:
			/**
			 * Default Constructor
			 *
			 * @param filename name of the log file
			 */
			Logger(const std::string &filename,
				const std::string &title);

			/**
			 * Default Destructor
			 */
			virtual ~Logger();

			/**
			 * Write a message into the logfile
			 *
			 * @param message the log message itself
			 */
			void Log(const std::string &message);
	};
}

#endif // end _LOGGER_H
